<template>
  <div id="mapBox"></div>
</template>
<script>
import AMap from 'AMap'
export default {
  data () {
    return {
      map: ''
    }
  },
  methods: {
    init () {
      this.map = new AMap.Map('mapBox', {
        zoom: 20,
        resizeEnable: true,
        mapStyle: 'amap://styles/d3fc11529eaf1d820d9d1d79da8a104c', // 设置地图的显示样式
        viewMode: '2D' // 使用3D视图
      })
      this.$emit('map', this.map)
    }
  },
  mounted () {
    this.init()
  }
}
</script>
<style rel="stylesheet/less" lang="less">
  #mapBox {
    position: absolute;
    height: 100%;
    width: 100%;
  }
</style>
